Write supervisor socked to /dev/shm in multi process docker file

Fixes running the multi-process docker image on the overlay storage driver which currently has issues with unix sockets.
Merges the default supervisord configuration options of /etc/supervisor/supervisord.conf with our previous overrides of
/etc/supervisor/conf.d/supervisord.conf.

Fixes #1502

Dominik Sander 8 years ago
parent
commit
d791ecc379
1 changed files with 24 additions and 3 deletions
  1. 24 3
      docker/multi-process/scripts/init

+ 24 - 3
docker/multi-process/scripts/init

@@ -56,21 +56,42 @@ case "${DATABASE_ADAPTER}" in
56 56
 esac
57 57
 
58 58
 # initialize supervisord config
59
+cat > /etc/supervisor/supervisord.conf <<EOF
60
+[unix_http_server]
61
+file=/dev/shm/supervisor.sock   ; (the path to the socket file)
62
+chmod=0700                       ; sockef file mode (default 0700)
59 63
 
60
-cat > /etc/supervisor/conf.d/supervisord.conf <<EOF
61 64
 [supervisord]
62 65
 nodaemon = true
63 66
 user = root
64 67
 stdout_logfile = AUTO
68
+logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
69
+pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
70
+childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)
65 71
 
66
-[unix_http_server]
67
-file=/var/run/supervisor.sock   ; (the path to the socket file)
72
+; the below section must remain in the config file for RPC
73
+; (supervisorctl/web interface) to work, additional interfaces may be
74
+; added by defining them in separate rpcinterface: sections
75
+[rpcinterface:supervisor]
76
+supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
77
+
78
+[supervisorctl]
79
+serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL  for a unix socket
68 80
 
69 81
 [eventlistener:stdout]
70 82
 command = supervisor_stdout
71 83
 buffer_size = 100
72 84
 events = PROCESS_LOG
73 85
 result_handler = supervisor_stdout:event_handler
86
+
87
+; The [include] section can just contain the "files" setting.  This
88
+; setting can list multiple files (separated by whitespace or
89
+; newlines).  It can also contain wildcards.  The filenames are
90
+; interpreted as relative to this file.  Included files *cannot*
91
+; include files themselves.
92
+
93
+[include]
94
+files = /etc/supervisor/conf.d/*.conf
74 95
 EOF
75 96
 
76 97
 # prepare the supervisord bootstrap service script